﻿@model AdventureWorks.Entities.Product

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Create", "Product", FormMethod.Post, new {enctype = "multipart/form-data"})) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Product</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductModel, "Product Model")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlProductModelID", String.Empty)
        </div>

		<div class="editor-label">
            @Html.LabelFor(model => model.ProductCategory, "Product Category")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ddlProductCategoryID", String.Empty)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ProductNumber)
            @Html.ValidationMessageFor(model => model.ProductNumber)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Color)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Color)
            @Html.ValidationMessageFor(model => model.Color)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.StandardCost)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StandardCost)
            @Html.ValidationMessageFor(model => model.StandardCost)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ListPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ListPrice)
            @Html.ValidationMessageFor(model => model.ListPrice)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Size)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Size)
            @Html.ValidationMessageFor(model => model.Size)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Weight)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Weight)
            @Html.ValidationMessageFor(model => model.Weight)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SellStartDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SellStartDate)
            @Html.ValidationMessageFor(model => model.SellStartDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SellEndDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SellEndDate)
            @Html.ValidationMessageFor(model => model.SellEndDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DiscontinuedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DiscontinuedDate)
            @Html.ValidationMessageFor(model => model.DiscontinuedDate)
        </div>

		<div class="editor-label">
            @Html.LabelFor(model => model.ThumbNailPhoto)
        </div>
        <div class="editor-field">
			<input type="file" name="ThumbNailPhotoImage" id="ThumbNailPhotoImage" />
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
	@Html.ActionLink("Back to List", "Index", new
	{
		ddlProductCategoryID = ViewBag.productCategoryID,
		ddlProductModelID = ViewBag.productModelID
	})
</div>
